import igraph
g = igraph.Graph()

# 创建节点
v0 = g.add_vertex()
# v0.attributes = {'z': 'zzz'}
v0.update_attributes({'z': 'zzz'})
print('v0: ', g.vs[0], v0)
v1_2 = g.add_vertices(2)
print('v1_2: ', g.vs[1], g.vs[2])
v3 = g.add_vertices('a')
print('v3: ', g.vs[3])
v4_5 = g.add_vertices(2, attributes={'p': 'pp'})
print('v4_5: ', g.vs[4], g.vs[5])
# vx = g.add_vertex()



# print('find v1: ', g.vs.find(1))
# print('find va: ', g.vs.find('a'))
# # print('select va: ', g.vs.select(0))
# print('vs: ', g.vs)

# e1 = g.add_edge(0, 1, a='xxx')
# print('e1: ', e1)
# print('select e1', g.es.select([0]))